// pages/my/my.js
import {doLogin} from "../../utils/my/index"
Page({
    data: {
        isShow:false
    },
    login(){
        doLogin({
            username:"admin",
            password:"123456"
        }).then(res=>{
            console.log(res);
            wx.setStorageSync('token', res.data.token)
                this.setData({
                    isShow:false
                })
        })
    },
onLoad(){
    if(wx.getStorageSync('token')==""){
        this.setData({
            isShow:true
        })
    }else {
        this.setData({
            isShow:false
        })
    }
}
    
})